// =================================================================
// File: cd.cpp
// Desc: Contains function for navigating to a particular directory
// =================================================================

// =================================================================
// INCLUDES
// =================================================================

#include <string>
#include "FSManager.h"
#include "commands.h"
#include "Directory.h"

using namespace std;

// =================================================================
// FUNCTIONS
// =================================================================

// =================================================================
// Name: cd
// Desc: Sets specified directory as the current directory
// Args: string dir_name - the directory to move into
//       FSManager* fsm - pointer to active FSManager object
// =================================================================
void cd(string dir_name, FSManager *fsm){

  Directory *currDir = fsm->ReadDirectory(dir_name);

  fsm->SetCurrentDirectory(currDir);
  
  cout << "Now in directory " << dir_name << endl;

}
